package com.haiya.infrastructure.db.dataobject;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

@TableName("ddd_cargo")
public class CargoDO {
    /**
     * mybatis-plus的insert方法，在底层会默认生成一个Long类型的UUID，
     * 这就导致跟数据库里面类型不一致导致错误，我们首先要做的是要把这个默认自增的主键给禁了
     * refer to https://blog.csdn.net/weixin_41036106/article/details/88546834
     */
    @TableId(value = "id",type = IdType.INPUT)
    private String id;
    private String senderPhone;
    private String description;
    private String originLocationCode;
    private String destinationLocationCode;

    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;
    @TableField(fill = FieldFill.UPDATE)
    private Date updatedAt;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSenderPhone() {
        return senderPhone;
    }

    public void setSenderPhone(String senderPhone) {
        this.senderPhone = senderPhone;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getOriginLocationCode() {
        return originLocationCode;
    }

    public void setOriginLocationCode(String originLocationCode) {
        this.originLocationCode = originLocationCode;
    }

    public String getDestinationLocationCode() {
        return destinationLocationCode;
    }

    public void setDestinationLocationCode(String destinationLocationCode) {
        this.destinationLocationCode = destinationLocationCode;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }
}
